import logoImage from "@/assets/logo.png";
import loginImage from "@/assets/login-logo.png";
import type {RouteRecordRaw} from "vue-router";
import LoginView from "@/views/login/index.vue";
import Layout from "@/layout/index.vue";

export const siteConfig = Object.freeze({
    title: "CICD 平台",
    logo: logoImage,
    loginImage: loginImage,
    loginDesc: "CICD 平台",
});

export const carouselInterval = 4000;

export const routeData: RouteRecordRaw[] = [
    {
        path: "/",
        name: "/",
        redirect: "/pm/overview",
        meta: {
            title: "首页",
            show: false,
            permission: "",
            icon: "HomeOutline",
        },
    },
    {
        path: "/login",
        name: "login",
        component: LoginView,
        meta: {
            title: "登录页",
            show: false,
            permission: "",
            icon: "LogInOutline",
        },
    },
    {
        path: "/common",
        name: "common",
        component: Layout,
        meta: {
            title: "公共",
            permission: "",
            icon: "CardOutline",
            show: false,
        },
        children: [
            {
                path: "tutorial",
                name: "tutorial",
                component: () => import("@/views/common/tutorial/index.vue"),
                meta: {
                    title: "教程",
                    show: false,
                    permission: "",
                },
            }
        ]
    },
    {
        path: "/pm",
        name: "pm",
        component: Layout,
        meta: {
            title: "流水线管理",
            permission: "",
            icon: "CardOutline",
            show: true,
            type: "group",
        },
        children: [
            {
                path: "overview",
                name: "overview",
                component: () => import("@/views/pm/overview/index.vue"),
                meta: {
                    title: "总览",
                    show: true,
                    permission: "",
                    icon: "CardOutline",
                },
            },
            {
                path: "pipelines",
                name: "pipelines",
                component: () => import("@/views/pm/pipelines/index.vue"),
                meta: {
                    title: "流水线",
                    show: true,
                    permission: "",
                    icon: "CardOutline",
                },
            },
            {
                path: "webhook",
                name: "webhook",
                component: () => import("@/views/pm/webhook/index.vue"),
                meta: {
                    title: "webhook",
                    show: true,
                    permission: "",
                    icon: "CardOutline",
                },
            },
        ],
    },
    // {
    //     path: "/",
    //     name: "分割线",
    //     component: Layout,
    //     meta: {
    //         title: "分割线",
    //         type: "divider"
    //     }
    // },
    {
        path: "/sm",
        name: "system",
        component: Layout,
        meta: {
            title: "系统管理",
            permission: "",
            icon: "LibraryOutline",
            show: true,
            type: "group",
        },
        children: [
            {
                path: "builder",
                name: "builder",
                component: () => import("@/views/sm/builder/index.vue"),
                meta: {
                    title: "构建服务器",
                    show: true,
                    permission: "",
                    icon: "OptionsSharp",
                },
            },
            {
                path: "deployer",
                name: "deployer",
                component: () => import("@/views/sm/deployer/index.vue"),
                meta: {
                    title: "部署服务器",
                    show: true,
                    permission: "",
                    icon: "OptionsSharp",
                },
            },
            {
                path: "compiler",
                name: "compiler",
                component: () => import("@/views/sm/compiler/index.vue"),
                meta: {
                    title: "编译环境",
                    show: true,
                    permission: "",
                    icon: "OptionsSharp",
                },
            },
            {
                path: "repository",
                name: "repository",
                component: () => import("@/views/sm/repository/index.vue"),
                meta: {
                    title: "镜像仓库",
                    show: true,
                    permission: "",
                    icon: "OptionsSharp",
                },
            },
            {
                path: "user",
                name: "user",
                component: () => import("@/views/sm/user/index.vue"),
                meta: {
                    title: "用户管理",
                    show: true,
                    permission: "",
                    icon: "OptionsSharp",
                },
            },
        ],
    },
    {
        path: "/common",
        name: "common",
        component: Layout,
        meta: {
            title: "产品指南",
            permission: "",
            icon: "LibraryOutline",
            show: true,
            type: "group",
        },
        children: [
            {
                path: "tutorial",
                name: "tutorial",
                component: () => import("@/views/common/tutorial/index.vue"),
                meta: {
                    title: "使用教程",
                    show: true,
                    permission: "",
                    icon: "OptionsSharp",
                },
            },
            {
                path: "cooperation",
                name: "cooperation",
                component: () => import("@/views/common/cooperation/index.vue"),
                meta: {
                    title: "商务合作",
                    show: true,
                    permission: "",
                    icon: "OptionsSharp",
                },
            },

        ],
    },
];
